import request from '@/utils/request'

export function getProjectRecordList(params) {
  return request({
    method: 'get',
    url: '/zhjs/projectRecord/query',
    params
  })
}
//详情
export function getProjectRecordDetail(params) {
  return request({
    method: 'get',
    url: '/zhjs/projectRecord/queryByIdAndStage',
    params
  })
}
//保存
export function saveFile(params) {
  // const data = JSON.stringify(params)
  // console.log(data, typeof data)
  return request({
    method: 'post',
    url: '/zhjs/projectRecord/insertRecordClFile',
    data: params
    // params
  })
}
//提交审核
export function submitRecordCheck(params) {
  return request({
    method: 'post',
    url: '/zhjs/projectRecord/submitRecordCheck',
    params
  })
}
//审核
export function setRecordCheck(params) {
  return request({
    method: 'post',
    url: '/zhjs/projectRecord/insertRecordCheck',
    data: params
  })
}
//附件导出
export function handleDaochu(params) {
  console.log()
  return request({
    method: 'get',
    url: '/zhjs/projectRecord/exportRecordClFile',
    params,
    responseType: 'blob',
    headers: {
      'Content-Type':
        'application/json; application/octet-stream'
    }
  })
}
//附件点击下载
export function downloadOneFile(params) {
  return request({
    method: 'get',
    url: `/resource/file/download`,
    params: { pkid: params.fileId },
    responseType: 'blob'
  })
}
//
//修改材料审核状态
export function editShenHeStatus(data) {
  return request({
    method: 'post',
    url: `/zhjs/projectRecord/editFileCheckStatus`,
    data
  })
}
